﻿namespace ZWFrameWork
{
    /// <summary>
    /// IByteArrays接口
    /// </summary>
    public interface IByteArrays
    {
        /// <summary>
        /// 返回数组长度
        /// </summary>
        int Length { get; }
        /// <summary>
        /// 从头部数组头部读取长度bytes
        /// </summary>
        /// <param name="length"></param>
        /// <returns></returns>
        byte[] Read(int length);
        /// <summary>
        /// 将bytes加到数组后面
        /// </summary>
        /// <param name="length"></param>
        /// <returns></returns>
        void Write(byte[] bytes);

        byte[] GetBytes(int length);
        /// <summary>
        /// 将bytes插入Array
        /// </summary>
        /// <param name="index"></param>
        /// <param name="bytes"></param>
        void Insert(int index, byte[] bytes);
    }
}